﻿<Window x:Class="Renci.iRods.Studio.Views.ConnectionProfileManagerView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"  
             xmlns:prism="http://www.codeplex.com/prism"
             xmlns:common="clr-namespace:Renci.iRods.Studio.Common;assembly=Renci.iRods.Studio.Common"
             xmlns:r="clr-namespace:Renci.iRods.Studio.Resources"
             mc:Ignorable="d"
             Width="Auto" 
             Height="Auto" 
             MinHeight="10"
             MinWidth="300"
             ResizeMode="NoResize"
             SizeToContent="WidthAndHeight"
             ShowInTaskbar="False"
             WindowStartupLocation="CenterOwner" 
             Title="{x:Static r:Strings.ConnectionProfileManagerViewModel_DialogName}">

    <Window.Resources>
        <ResourceDictionary Source="/Renci.iRods.Studio;component/Resources/View.Resources.xaml" />
    </Window.Resources>

    <i:Interaction.Triggers>
        <prism:InteractionRequestTrigger SourceObject="{Binding ShowMessageBoxRequest}">
            <common:DialogWindowAction/>
        </prism:InteractionRequestTrigger>
    </i:Interaction.Triggers>

    <DockPanel>
        <TextBlock 
                DockPanel.Dock="Top"
                Text="{x:Static r:Strings.ConnectionProfileManagerViewModel_DialogTitle}" 
                Width="{Binding ElementName=Content, Path=ActualWidth}"
                TextWrapping="Wrap"
                VerticalAlignment="Center" 
                FontFamily="Arial" 
                FontSize="18" 
                Foreground="#FFF9F9F9"                       
                Background="#FF4B6C9E"
                Padding="5,5,5,5"
                Margin="0,0,0,0"
                       />
        <StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom">
            <Button HorizontalAlignment="Right" MinWidth="80" Margin="3" Content="Test" Command="{Binding TestProfileCommand}"/>
            <Button HorizontalAlignment="Right" MinWidth="80" Margin="3" Content="Delete" Command="{Binding Path=DeleteProfileCommand}"/>
            <Button HorizontalAlignment="Right" MinWidth="80" Margin="3" Content="Save" Command="{Binding Path=SaveProfileCommand}"/>
            <Button HorizontalAlignment="Right" MinWidth="80" Margin="3" Content="Cancel" Command="{Binding Path=CancelProfileCommand}" />
        </StackPanel>

        <!--<Border>-->
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="28" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="200" />
                <ColumnDefinition Width="30" />
            </Grid.ColumnDefinitions>

            <Label Grid.Row="0" Grid.Column="0" Content="Profile:"/>
            <Label Grid.Row="1" Grid.Column="0" Content="Profile Name:"/>
            <Label Grid.Row="2" Grid.Column="0" Content="Host:"/>
            <Label Grid.Row="3" Grid.Column="0" Content="Port:"/>
            <Label Grid.Row="4" Grid.Column="0" Content="Username:"/>
            <Label Grid.Row="5" Grid.Column="0" Content="Password:" />
            <Label Grid.Row="6" Grid.Column="0" Content="Resource Name:" />
            <Label Grid.Row="7" Grid.Column="0" Content="Zone Name:" />
            <Label Grid.Row="8" Grid.Column="0" Content="Favorite:" />

            <ComboBox Grid.Row="0" Grid.Column="1" Margin="3"
            ItemsSource="{Binding Path=ConnectionProfiles}"
            DisplayMemberPath="Name"
            SelectedItem="{Binding SelectedConnectionProfile}"/>

            <TextBox Grid.Row="1" Grid.Column="1" Margin="3" Text="{Binding SelectedConnectionProfile.Name, ValidatesOnDataErrors=true, NotifyOnValidationError=true}" />
            <TextBox Grid.Row="2" Grid.Column="1" Margin="3" Text="{Binding SelectedConnectionProfile.Host, ValidatesOnDataErrors=true, NotifyOnValidationError=true}" />
            <TextBox Grid.Row="3" Grid.Column="1" Margin="3" Text="{Binding SelectedConnectionProfile.Port, ValidatesOnDataErrors=true, NotifyOnValidationError=true}" />
            <TextBox Grid.Row="4" Grid.Column="1" Margin="3" Text="{Binding SelectedConnectionProfile.Username, ValidatesOnDataErrors=true, NotifyOnValidationError=true}" />
            <TextBox Grid.Row="5" Grid.Column="1" Margin="3" Text="{Binding SelectedConnectionProfile.Password, ValidatesOnDataErrors=true, NotifyOnValidationError=true}" />
            <TextBox Grid.Row="6" Grid.Column="1" Margin="3" Text="{Binding SelectedConnectionProfile.ResourceName}" />
            <TextBox Grid.Row="7" Grid.Column="1" Margin="3" Text="{Binding SelectedConnectionProfile.ZoneName}" />
            <CheckBox Grid.Row="8" Grid.Column="1" Margin="3" IsChecked="{Binding SelectedConnectionProfile.IsFavorite}" />
        </Grid>
        <!--</Border>-->
    </DockPanel>
</Window>
